package com.jn.controller;

import com.jn.entity.User;
import com.jn.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * @ClassName IndexController
 * @Package com.jn.controller
 * @Description TODO
 * @Author zhixingbai
 * @Create 2018/7/309:48
 */
@Controller
public class IndexController {

    @Autowired
    private UserService userService;

    @RequestMapping("/")
    public String toIndex(HttpServletRequest request){
        User user= userService.getUser(1);
        request.setAttribute("user",user);
        return "index";
    }
}
